Vue.component('Detail', {
	template: `
		<el-dialog title="查看详情" width="600px" class="icon-dialog" :visible.sync="show" @open="open" :before-close="closeForm" append-to-body>
			<div id="detail">
			<table cellpadding="0" cellspacing="0" class="table table-bordered" align="center" width="100%" style="word-break:break-all; margin-bottom:30px;  font-size:13px;">
				<tbody>
					<tr>
						<td class="title" width="100">订单编号：</td>
						<td>
							{{form.order_num}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">订单类型：</td>
						<td>
							<span v-if="form.order_type == '1'">家长需求</span>
							<span v-if="form.order_type == '2'">老师兼职</span>
							<span v-if="form.order_type == '3'">直接购买</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">家长名称：</td>
						<td>
							<span v-if="form.parent_name">{{form.parent_name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">老师ID：</td>
						<td>
							{{form.teacher_id}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">老师名称：</td>
						<td>
							<span v-if="form.teacher_name">{{form.teacher_name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">课时单价：</td>
						<td>
							{{form.class_fee}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">课时数量：</td>
						<td>
							{{form.class_num}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">课时时长：</td>
						<td>
							{{form.class_hour}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">课时总费用：</td>
						<td>
							{{form.total_amount}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">平台费用：</td>
						<td>
							{{form.platform_amount}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">实付费用：</td>
						<td>
							{{form.actul_amount}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">订单状态：</td>
						<td>
							<span v-if="form.order_status == '0'">未支付</span>
							<span v-if="form.order_status == '1'">进行中</span>
							<span v-if="form.order_status == '2'">已完成</span>
							<span v-if="form.order_status == '3'">已取消</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">支付状态：</td>
						<td>
							<span v-if="form.pay_status == '0'">待支付</span>
							<span v-if="form.pay_status == '1'">已支付</span>
							<span v-if="form.pay_status == '2'">部分退款</span>
							<span v-if="form.pay_status == '3'">全部退款</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">已上课数量：</td>
						<td>
							{{form.use_class_num}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">创建时间：</td>
						<td>
							{{parseTime(form.create_time)}}
						</td>
					</tr>
				</tbody>
			</table>
			</div>
		</el-dialog>
	`
	,
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
			form:{
			},
		}
	},
	methods: {
		open(){
			axios.post(base_url+'/Order.Order/detail',this.info).then(res => {
				this.form = res.data.data
			})
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
})
